﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace wars2
{
    internal class Operations
    {
        public double firstValue;
        public double secondValue;
        public char mathSign;
        double mathCalculationsAddition(double secondSummand)
        {
            firstValue += secondSummand;
            return firstValue;
        }
        public double mathCalculationsSubtraction(double subtrahend)
        {
            firstValue -= subtrahend;
            return firstValue;
        }
        public double mathCalculationsMultiplications(double multiplier)
        {
            firstValue *= multiplier;
            return firstValue;
        }
        public double mathCalculationsDivision(double dividend)
        {
            firstValue /= dividend;
            return firstValue;
        }
        public string operationType(char mathSign)
        {
            mathSign = this.mathSign;
            switch (mathSign)
            {
                case '+':
                    return "\nType second Summand";
                case '-':
                    return "\nType subtrahend";
                case '*':
                    return "\nType multiplier";
                case '/':
                    return "\nType dividend";
                default:
                    Console.WriteLine("\nincorrect Value, try again");

                    return operationType(mathSign);
            }
        }
        public double MathCalculationSwitch(double secondValue, char mathSign)
        {
            mathSign = this.mathSign;
            secondValue = this.secondValue;
            switch(mathSign){
                case '+':
                    return mathCalculationsAddition(secondValue);
                case '-':
                    return mathCalculationsSubtraction(secondValue);
                case '*':
                    return mathCalculationsMultiplications(secondValue);
                case '/':
                    return mathCalculationsDivision(secondValue);
                default: 
                    return MathCalculationSwitch(0 , '-');
            }
         
        }
    }
}
